]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
make NetworkManager optional
authorMichael Biebl <biebl@debian.org>
Tue, 11 Feb 2014 22:20:15 +0000 (17:20 -0500)
committerRyan Lortie <desrt@desrt.ca>
Tue, 11 Feb 2014 23:04:44 +0000 (18:04 -0500)
NetworkManager is only available on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=669495

configure.ac
js/Makefile.am
js/misc/config.js.in
js/ui/panel.js
js/ui/sessionMode.js
src/Makefile.am

index 4624bfe6faf478ec60270f27b8d021b6cc4bf456..2ab00cda981b7fabfe879c6ca07a234acf975f88 100644 (file)
@@ -105,9 +105,7 @@ SHARED_PCS="gio-unix-2.0 >= $GIO_MIN_VERSION
             libcanberra libcanberra-gtk3
             telepathy-glib >= $TELEPATHY_GLIB_MIN_VERSION
             polkit-agent-1 >= $POLKIT_MIN_VERSION
-            libnm-glib libnm-util >= $NETWORKMANAGER_MIN_VERSION
-            libnm-gtk >= $NETWORKMANAGER_MIN_VERSION
-            libsecret-unstable gcr-base-3 >= $GCR_MIN_VERSION"
+            gcr-base-3 >= $GCR_MIN_VERSION"
 if test x$have_systemd = xyes; then
   SHARED_PCS="${SHARED_PCS} libsystemd-journal"
 fi
@@ -182,6 +180,38 @@ if test "$langinfo_ok" = "yes"; then
             [Define if _NL_TIME_FIRST_WEEKDAY is available])
 fi
 
+AC_ARG_ENABLE(networkmanager,
+             AS_HELP_STRING([--disable-networkmanager],
+                            [disable NetworkManager support  @<:@default=auto@:>@]),,
+              [enable_networkmanager=auto])
+
+if test "x$enable_networkmanager" != "xno"; then
+   PKG_CHECK_MODULES(NETWORKMANAGER,
+                     [libnm-glib
+                     libnm-util >= $NETWORKMANAGER_MIN_VERSION
+                     libnm-gtk >= $NETWORKMANAGER_MIN_VERSION
+                     libsecret-unstable],
+                     [have_networkmanager=yes],
+                     [have_networkmanager=no])
+
+   GNOME_SHELL_CFLAGS="$GNOME_SHELL_CFLAGS $NETWORKMANAGER_CFLAGS"
+   GNOME_SHELL_LIBS="$GNOME_SHELL_LIBS $NETWORKMANAGER_LIBS"
+else
+   have_networkmanager="no  (disabled)"
+fi
+
+if test "x$have_networkmanager" = "xyes"; then
+   AC_DEFINE(HAVE_NETWORKMANAGER, [1], [Define if we have NetworkManager])
+   AC_SUBST([HAVE_NETWORKMANAGER], [1])
+else
+   if test "x$enable_networkmanager" = "xyes"; then
+      AC_MSG_ERROR([Couldn't find NetworkManager.])
+   fi
+   AC_SUBST([HAVE_NETWORKMANAGER], [0])
+fi
+
+AM_CONDITIONAL(HAVE_NETWORKMANAGER, test "$have_networkmanager" = "yes")
+
 # Sets GLIB_GENMARSHAL and GLIB_MKENUMS
 AM_PATH_GLIB_2_0()
 
@@ -223,3 +253,15 @@ AC_CONFIG_FILES([
   man/Makefile
 ])
 AC_OUTPUT
+
+echo "
+Build configuration:
+
+       Prefix:                                 ${prefix}
+       Source code location:                   ${srcdir}
+       Compiler:                               ${CC}
+       Compiler Warnings:                      $enable_compile_warnings
+
+       Support for NetworkManager:             $have_networkmanager
+       Support for GStreamer recording:        $build_recorder
+"
index e51c4fbe7435d15b243382998abf5c22f4204b82..09ceab16b25bd493eb69aff592c2140d8a3f9aed 100644 (file)
@@ -6,6 +6,7 @@ misc/config.js: misc/config.js.in Makefile
        sed -e "s|[@]PACKAGE_NAME@|$(PACKAGE_NAME)|g" \
            -e "s|[@]PACKAGE_VERSION@|$(PACKAGE_VERSION)|g" \
            -e "s|[@]HAVE_BLUETOOTH@|$(HAVE_BLUETOOTH)|g" \
+           -e "s|[@]HAVE_NETWORKMANAGER@|$(HAVE_NETWORKMANAGER)|g" \
            -e "s|[@]GETTEXT_PACKAGE@|$(GETTEXT_PACKAGE)|g" \
            -e "s|[@]datadir@|$(datadir)|g" \
            -e "s|[@]libexecdir@|$(libexecdir)|g" \
index 9769104c41ca77a3b43cdd580c7cc9dc2b538fd4..9c4795dc49865b3385cf88b8bdf678e1161605bf 100644 (file)
@@ -6,6 +6,8 @@ const PACKAGE_NAME = '@PACKAGE_NAME@';
 const PACKAGE_VERSION = '@PACKAGE_VERSION@';
 /* 1 if gnome-bluetooth is available, 0 otherwise */
 const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
+/* 1 if networkmanager is available, 0 otherwise */
+const HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
 /* gettext package */
 const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
 /* locale dir */
index a54555205af60916964a168c03551457497c1a94..62614ca337e41409ffd576f79b653056d100ea57 100644 (file)
@@ -812,7 +812,11 @@ const AggregateMenu = new Lang.Class({
         this._indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box' });
         this.actor.add_child(this._indicators);
 
-        this._network = new imports.ui.status.network.NMApplet();
+        if (Config.HAVE_NETWORKMANAGER) {
+            this._network = new imports.ui.status.network.NMApplet();
+        } else {
+            this._network = null;
+        }
         if (Config.HAVE_BLUETOOTH) {
             this._bluetooth = new imports.ui.status.bluetooth.Indicator();
         } else {
@@ -829,7 +833,9 @@ const AggregateMenu = new Lang.Class({
 
         this._indicators.add_child(this._screencast.indicators);
         this._indicators.add_child(this._location.indicators);
-        this._indicators.add_child(this._network.indicators);
+        if (this._network) {
+            this._indicators.add_child(this._network.indicators);
+        }
         if (this._bluetooth) {
             this._indicators.add_child(this._bluetooth.indicators);
         }
@@ -841,7 +847,9 @@ const AggregateMenu = new Lang.Class({
         this.menu.addMenuItem(this._volume.menu);
         this.menu.addMenuItem(this._brightness.menu);
         this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
-        this.menu.addMenuItem(this._network.menu);
+        if (this._network) {
+            this.menu.addMenuItem(this._network.menu);
+        }
         if (this._bluetooth) {
             this.menu.addMenuItem(this._bluetooth.menu);
         }
index 69715e4dda2d215c6c3b9c59120a3f8d0da1f3dc..599b51cfdc819d5b12b456033f49d9b21d3f11d6 100644 (file)
@@ -10,6 +10,8 @@ const FileUtils = imports.misc.fileUtils;
 const Main = imports.ui.main;
 const Params = imports.misc.params;
 
+const Config = imports.misc.config;
+
 const DEFAULT_MODE = 'restrictive';
 
 const _modes = {
@@ -92,8 +94,12 @@ const _modes = {
         isLocked: false,
         isPrimary: true,
         unlockDialog: imports.ui.unlockDialog.UnlockDialog,
-        components: ['networkAgent', 'polkitAgent', 'telepathyClient',
+        components: Config.HAVE_NETWORKMANAGER ?
+                    ['networkAgent', 'polkitAgent', 'telepathyClient',
+                     'keyring', 'autorunManager', 'automountManager'] :
+                    ['polkitAgent', 'telepathyClient',
                      'keyring', 'autorunManager', 'automountManager'],
+
         panel: {
             left: ['activities', 'appMenu'],
             center: ['dateMenu'],
index 59c9d8f2320993974bb014531258c87b82e554b5..f489a56cdb225f251e6a7c13b3450fca6dd3d64f 100644 (file)
@@ -98,7 +98,6 @@ shell_public_headers_h =              \
        shell-invert-lightness-effect.h \
        shell-keybinding-modes.h        \
        shell-mount-operation.h         \
-       shell-network-agent.h           \
        shell-perf-log.h                \
        shell-screenshot.h              \
        shell-slicer.h                  \
@@ -110,6 +109,10 @@ shell_public_headers_h =           \
        shell-window-tracker.h          \
        shell-wm.h
 
+if HAVE_NETWORKMANAGER
+shell_public_headers_h +=  shell-network-agent.h
+endif
+
 libgnome_shell_menu_la_SOURCES =       \
        gtkactionmuxer.h                \
        gtkactionmuxer.c                \
@@ -136,7 +139,6 @@ libgnome_shell_base_la_SOURCES =    \
        shell-menu-tracker.c            \
        shell-menu-tracker.h            \
        shell-mount-operation.c         \
-       shell-network-agent.c           \
        shell-perf-log.c                \
        shell-polkit-authentication-agent.h     \
        shell-polkit-authentication-agent.c     \
@@ -147,6 +149,10 @@ libgnome_shell_base_la_SOURCES =   \
        shell-tp-client.c               \
        $(NULL)
 
+if HAVE_NETWORKMANAGER
+libgnome_shell_base_la_SOURCES +=  shell-network-agent.c
+endif
+
 libgnome_shell_sources =               \
        $(shell_public_headers_h)       \
        shell-app-private.h             \
@@ -343,7 +349,10 @@ INTROSPECTION_GIRS += ShellMenu-0.1.gir
 CLEANFILES += ShellMenu-0.1.gir
 
 Shell-0.1.gir: gnome-shell St-1.0.gir ShellMenu-0.1.gir
-Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-3.0 TelepathyGLib-0.12 Soup-2.4 GMenu-3.0 NetworkManager-1.0 NMClient-1.0
+Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-3.0 TelepathyGLib-0.12 Soup-2.4 GMenu-3.0
+if HAVE_NETWORKMANAGER
+Shell_0_1_gir_INCLUDES += NetworkManager-1.0 NMClient-1.0
+endif
 Shell_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir)
 # Hack! we use PROGRAM instead of LIBS so that the soname is not included
 # in the typelib. This way the symbols will be resolved with the libgnome-shell